package com.dragon.linkedlist;

/**
 * @author dragon
 * @version 1.0
 * @description 自定义链表测试
 * @date created in 2018-12-14
 */
public class LinkedListTest {

    public static void main(String[] args) {
        LinkedList<Integer> list = new LinkedList<>();
        int i = 1;
        while (i < 11) {
            list.addLast(i++);
        }
        System.out.println(list.toString());
        list.addFirst(11);
        list.add(12, 2);
        list.add(13, 0);
        System.out.println(list.toString());
        list.remove(0);
        System.out.println("获取的元素为:" + list.get(0));
        list.set(0, 14);
        System.out.println(list.toString());
        list.print();
        list.add(10);
        System.out.println(list);
        list.print();
    }
}
